package com.example.coursehub.classmanagement.service;

import com.example.coursehub.classmanagement.entity.Class;
import com.example.coursehub.classmanagement.entity.StudentClass;

import java.util.List;
import java.util.Optional;

/**
 * 班级管理服务接口
 */
public interface ClassService {
    
    // 班级相关操作
    Class createClass(Class clazz);
    Class updateClass(Long id, Class clazz);
    void deleteClass(Long id);
    Optional<Class> getClassById(Long id);
    List<Class> getAllClasses();
    List<Class> getClassesByCourse(Long courseId);
    List<Class> getClassesByTeacher(Long teacherId);
    List<Class> searchClassesByName(String name);
    List<Class> getAvailableClasses();
    
    // 学生班级关联操作
    StudentClass joinClass(Long studentId, Long classId);
    void leaveClass(Long studentId, Long classId);
    List<StudentClass> getStudentsByClass(Long classId);
    List<StudentClass> getClassesByStudent(Long studentId);
    boolean isStudentInClass(Long studentId, Long classId);
    
    // 统计相关操作
    long getActiveStudentCount(Long classId);
    long getClassCountByTeacher(Long teacherId);
    long getClassCountByCourse(Long courseId);
}